"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;

var _events = require("events");

var _CheckSuccess = _interopRequireDefault(require("./CheckSuccess"));

var _CheckError = _interopRequireDefault(require("./CheckError"));

var _LoginSuccess = _interopRequireDefault(require("./LoginSuccess"));

var _LoginError = _interopRequireDefault(require("./LoginError"));

var _NoLogin = _interopRequireDefault(require("./NoLogin"));

var _Logout = _interopRequireDefault(require("./Logout"));

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

//创建事件
var event = new _events.EventEmitter();
event.on('cas.check.success', function (_ref) {
  var ticket = _ref.ticket,
      user = _ref.user;
  (0, _CheckSuccess.default)(ticket, user);
});
event.on('cas.check.error', function (data) {
  (0, _CheckError.default)(data);
});
event.on('cas.login.success', function (data) {
  (0, _LoginSuccess.default)(data);
});
event.on('cas.login.error', function (data) {
  (0, _LoginError.default)(data);
});
event.on('cas.nologin', function () {
  (0, _NoLogin.default)();
});
event.on('cas.logout', function (data) {
  (0, _Logout.default)(data);
});
var _default = event;
exports.default = _default;